import React, { createRef } from 'react'
import Hellow from '../components/Hellow/hellow'
import HellowClass from '../components/Hellow/hellowClass'

// 组件通信
import ChildrenDemo1 from '../components/communication/demo1'
import DemoRef from '@/components/communication/demoref'

import LifeDemo from '@/components/LifeDemo/life'

import LayoutConent from '@/Layout/index'

export default function IndexPage() {
  // let person = {
  //   name: 'fanmu',
  //   sex: '男',
  //   age: 18
  // }
  // const handleClickDemo1 = (e: string) => {
  //   console.log('父组件接受的内容', e)
  // }

  // const childrendmeo1ref = createRef<ChildrenDemo1>()
  return (
    <div>
      {/* <Hellow name='Hellow'/>
      <HellowClass name="helloclass" person={person}/>
      <h1>props默认值</h1> */}
      {/* <HellowClass name="helloclass" /> */}
      {/* 可以通过ref来获取子组件内容或者调用其方法
      <button onClick={() => {
        console.log(childrendmeo1ref.current)
      }}>获取子组件ref</button> */}
      {/* <ChildrenDemo1 ref={childrendmeo1ref} {...person} onClick={(e) => handleClickDemo1(e)}/> */}
      {/* <br /> */}
      {/* <DemoRef /> */}
      {/* <LifeDemo /> */}
      <LayoutConent />
    </div>
  );
}
